
#include "HttpCmdGetIfconfig.h"
#include "SysInfo.h"


CHttpCmdGetIfconfig::CHttpCmdGetIfconfig()
{ 

}

CHttpCmdGetIfconfig::~CHttpCmdGetIfconfig()
{

}

bool CHttpCmdGetIfconfig::CheckParamVaild(const std::string &strReqMessage)
{
    return true;
}

bool CHttpCmdGetIfconfig::FillRspData(std::string &strRspData)
{
    std::string strEthName,  strMacAddr,  strIpAddr,  strNetMask,  strGateWay;
    strEthName = "eth0";
    CSysInfo::GetNetworkInfo(strEthName,  strMacAddr,  strIpAddr,  strNetMask,  strGateWay);

    // need some system helper functions
    neb::CJsonObject rspJsonObj;
    rspJsonObj.AddEmptySubObject("Data");
    neb::CJsonObject &dataJsonObj = rspJsonObj["Data"];


    dataJsonObj.Add("MacAddr", strMacAddr);

    dataJsonObj.Add("IpAddr", strIpAddr);

    dataJsonObj.Add("NetMask", strNetMask);

    dataJsonObj.Add("GateWay", strGateWay);


    strRspData = rspJsonObj.ToString();
}

void CHttpCmdGetIfconfig::ClearCmdLocalData()
{
    return ;
}

